Source for file Rights.php
Documentation is available at Rights.php
<?php require_once 'index.php'; ?>
$currentArea = $admin->perm ->getAreas ();
if (empty ($currentArea)) {
echo 'Run the <b>Area</b> test first<br />';
$areas = $admin->perm ->getAreas ();
echo '<strong>Error on line: '.__LINE__. '</strong><br (>';
foreach ($areas as $row) {
for ($i = 1; $i < 20; $i++ ) {
'area_id' => $row['area_id'],
'right_define_name' => 'RIGHT_' . $row['area_id'] . '_' . rand(),
$rightId = $admin->perm ->addRight ($data);
if ($rightId === false ) {
echo '<strong>Error on line: '.__LINE__. ' last query: '. $admin->perm ->_storage ->dbc ->last_query. '</strong><br />';
echo 'Created Right Id <b>'. $rightId. '</b><br />';
$currentRights = $admin->perm ->getRights ();
if ($currentRights === false ) {
echo '<strong>Error on line: '.__LINE__. ' last query: '. $admin->perm ->_storage ->dbc ->last_query. '</strong><br />';
echo 'These are our current rights:';
Var_Dump ::display ($currentRights);
$filters = array ('right_id' => $currentRights[$id]['right_id']);
$rmRight = $admin->perm ->removeRight ($filters);
if ($rmRight === false ) {
echo '<strong>Error on line: '.__LINE__. ' last query: '. $admin->perm ->_storage ->dbc ->last_query. '</strong><br />';
echo '<b>Right_' . $id . '</b> was removed<br />';
$data = array ('right_define_name' => 'RIGHT_' . $id . '_UPDATED');
$filters = array ('right_id' => $currentRights[$id]['right_id']);
$upRight = $admin->perm ->updateRight ($data, $filters);
if ($upRight === false ) {
echo '<strong>Error on line: '.__LINE__. ' last query: '. $admin->perm ->_storage ->dbc ->last_query. '</strong><br />';
echo '<b>Right_'. $id . '</b> was updated<br />';
$params = array ('filters' => array ('right_id' => $currentRights[$id]['right_id']));
$result = $admin->perm ->getRights ($params);
echo '<strong>Error on line: '.__LINE__. ' last query: '. $admin->perm ->_storage ->dbc ->last_query. '</strong><br />';
Var_Dump ::display ($result);
$currentRights = $admin->perm ->getRights ();
if ($currentRights === false ) {
echo '<strong>Error on line: '.__LINE__. ' last query: '. $admin->perm ->_storage ->dbc ->last_query. '</strong><br />';
echo 'These are our current rights:';
Var_Dump ::display ($currentRights);
Documentation generated on Mon, 11 Mar 2019 14:00:09 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|